
<!DOCTYPE html>
<html lang="zh-cmn-Hans">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width,initial-scale=1,user-scalable=0,viewport-fit=cover">
    <title>投诉</title>
    <link rel="stylesheet" href="/${BasePath}/static/css/weui.css" media="all" />
    <style type="text/css">
    	body{
    		background-color: #f5f6f7
    	}
        .aui-flex {
		    display: -webkit-box;
		    display: -webkit-flex;
		    display: flex;
		    -webkit-box-align: center;
		    -webkit-align-items: center;
		    align-items: center;
		    padding: 10px 15px;
		    position: relative;
		    background:#fff
		}
		.aui-navBar:after,.b-line:after {
		    content: '';
		    position: absolute;
		    z-index: 2;
		    bottom: 0;
		    left: 0;
		    width: 100%;
		    height: 1px;
		    border-bottom: 1px solid #b2b2b2;
		    -webkit-transform: scaleY(0.5);
		    transform: scaleY(0.5);
		    -webkit-transform-origin: 0 100%;
		    transform-origin: 0 100%;
		}
		.aui-flex-box {
		    -webkit-box-flex: 1;
		    -webkit-flex: 1;
		    flex: 1;
		    min-width: 0;
		    font-size: 14px;
		    color: #666;
		}
		.ui-radio {
		    line-height: 25px;
		    display: inline-block;
		}
		.ui-radio input {
		    display: inline-block;
		    width: 26px;
		    height: 26px;
		    position: relative;
		    overflow: visible;
		    border: 0;
		    background: none;
		    -webkit-appearance: none;
		    outline: none;
		    margin-right: 8px;
		    vertical-align: middle;
		}
		
		.ui-radio input:before {
		    content: '';
		    display: block;
		    width: 24px;
		    height: 24px;
		    border: 1px solid #dfe0e1;
		    border-radius: 13px;
		    -webkit-background-clip: padding-box;
		    background-clip: padding-box;
		    position: absolute;
		    left: 0px;
		    top: 0
		}
		
		.ui-radio input:checked:after {
		    content: '';
		    display: block;
		    width: 14px;
		    height: 14px;
		    background: #18b4ed;
		    border-radius: 7px;
		    position: absolute;
		    left: 6px;
		    top: 6px
		}
		.btn-area{
			padding:15px
		}
    </style>
</head>
<body ontouchstart>
    <div class="main">
    	<div class="weui-cells__title">请选择投诉理由</div>
    	<div class="aui-flex b-line radioline">
			<div class="aui-flex-box">
				<label class="ui-radio">
					<input type="radio" name="radio" value="欺诈">
				</label>
				欺诈
			</div>
		</div>
		<div class="aui-flex b-line radioline">
			<div class="aui-flex-box">
				<label class="ui-radio">
					<input type="radio" name="radio" value="色情">
				</label>
				色情
			</div>
		</div>
		<div class="aui-flex b-line radioline">
			<div class="aui-flex-box">
				<label class="ui-radio">
					<input type="radio" name="radio" value="政治谣言">
				</label>
				政治谣言
			</div>
		</div>
		<div class="aui-flex b-line radioline">
			<div class="aui-flex-box">
				<label class="ui-radio">
					<input type="radio" name="radio" value="常识性谣言">
				</label>
				常识性谣言
			</div>
		</div>
		<div class="aui-flex b-line radioline">
			<div class="aui-flex-box">
				<label class="ui-radio">
					<input type="radio" name="radio" value="诱导分享">
				</label>
				诱导分享
			</div>
		</div>
		<div class="aui-flex b-line radioline">
			<div class="aui-flex-box">
				<label class="ui-radio">
					<input type="radio" name="radio" value="恶意营销">
				</label>
				恶意营销
			</div>
		</div>
		<div class="aui-flex b-line radioline">
			<div class="aui-flex-box">
				<label class="ui-radio">
					<input type="radio" name="radio" value="隐私信息收集">
				</label>
				隐私信息收集
			</div>
		</div>
		<div class="aui-flex b-line radioline">
			<div class="aui-flex-box">
				<label class="ui-radio">
					<input type="radio" name="radio" value="抄袭公众号文章">
				</label>
				抄袭公众号文章
			</div>
		</div>
		<div class="aui-flex b-line radioline">
			<div class="aui-flex-box">
				<label class="ui-radio">
					<input type="radio" name="radio" value="其它侵权类（冒名，诽谤，抄袭）">
				</label>
				其它侵权类（冒名，诽谤，抄袭）
			</div>
		</div>
		<div class="aui-flex b-line radioline">
			<div class="aui-flex-box">
				<label class="ui-radio">
					<input type="radio" name="radio" value="违规声明原创">
				</label>
				违规声明原创
			</div>
		</div>
		<div class="aui-flex">
			<textarea class="weui-textarea" id="content" placeholder="请输入投诉内容" rows="3"></textarea>
		</div>
		<div class="btn-area">
			<a href="javascript:;" class="weui-btn weui-btn_block weui-btn_primary save">确认</a>
		</div>
    </div>
    <script type="text/javascript" src="/${BasePath}/static/js/zepto.min.js"></script>
    <script type="text/javascript" src="/${BasePath}/static/js/vue.min.js"></script>
    <script type="text/javascript" src="/${BasePath}/static/js/axios.min.js"></script>
    <script type="text/javascript">
    function getUrlParam(b) {
        var c = new RegExp("(^|&)" + b + "=([^&]*)(&|$)","i");
        var a = window.location.search.substr(1).match(c);
        if (a != null && a[2] != "null") {
            return decodeURIComponent(a[2])
        }
        return null
    }
    var  id = Number(getUrlParam('activityid'));
    $('.radioline').on('click',function(){
		$(this).find("input").prop("checked", true);
		var value = $('input[name="radio"]:checked').val()
		
	})
    $('body').on('click','.save',function(){
    	if($('input[name="radio"]:checked').length == 0){
    		alert("请选择一条理由");
    		return false
    	}
    	if($('#content').val() == ""){
    		alert("请输入投诉内容");
    		return false
    	}
    	$.ajax({
    		type: 'post',
    		url: '/${BasePath}/free/saveComplain',
    		data: {
    			type: $('input[name="radio"]:checked').val(),
    			activityid: id,
    			content: $("#content").val()
    		},
    		success:function(res){
    			if(res.code == "1"){
    				alert("提交成功");
    				window.location.href = "/${BasePath}/free/playerList?activityid=" + id
    			}
    			else{
    				alert("系统错误,请稍后再试");
    			}
    		},
    		error: function(){
    			alert("系统错误,请稍后再试");
    		}
    	})
    })
    </script>
</body>
</html>
